﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shared.Model
{
    public class SharedData
    {

        public const int WAIT_TIMES = 6;//socket waitting times, abandoning,disuse

        public const string CAN_TEST = "0";//申请测试
        public const string TEST_RESULT = "1";//返回测试结果
        public const string SAVE_TEST_DATA = "2";//写测试数据
        //public const string PACKET_END = "\r\n";//消息结束


        public const long FIRST_EPON_MAC = 0xFCDE00000001;
        public const long FIRST_GPON_MAC = 0xFCDF00000001;


        public const string YCD_MAC_EPON_START = "FCDE";
        public const string YCD_MAC_GPON_START = "FCDF";

        public const string EPON = "EPON";
        public const string STIA = "STIA";


        //包装数据
        public const int BOX_NUMBER = 20;


        //HPSOCKET的包大小和标志
        //public const ushort PACK_HANDER_FLAG= 0xFF;
        //public const uint MAX_PACK_SIZE = 0x1000;
        //public const ushort HP_SERVER_PORT = 26398;
        //public const string ANY_IP = "0.0.0.0";


        //first company's scanning devices
        public static readonly byte[] OPEN_MODEM = { 0x07, 0xC6, 0x04, 0x08, 0x00, 0x8A, 0x08, 0xFE, 0x95 };
        public static readonly byte[] SCAN = { 0x04, 0xE4, 0x04, 0x00, 0xFF, 0x14 };
        public static readonly byte[] SCAN_ACK = { 0x04, 0xD0, 0x00, 0x00, 0xFF, 0x2C };

        //second company's scanning devices
        public static readonly byte[] SCAN2 = { 0x1B, 0x31 };
        public static readonly byte[] SCAN2_ACK = { 0x06 };

        //close and open power
        public static byte[] POWER_OFF_COMMAND = new byte[8] { 0x33, 0x01, 0x12, 0x00, 0x00, 0x00, 0x01, 0x46 };
        public static byte[] POWER_ON_COMMAND = new byte[8] { 0x33, 0x01, 0x11, 0x00, 0x00, 0x00, 0x01, 0x46 };

        //recv bytes from serial port
        public static byte[] POWER_OFF_COMMAND_RECV = new byte[8] { 0x22, 0x01, 0x12, 0x00, 0x00, 0x00, 0x01, 0x46 };
        public static byte[] POWER_ON_COMMAND_RECV = new byte[8] { 0x22, 0x01, 0x11, 0x00, 0x00, 0x00, 0x01, 0x46 };

        //TEST_RESULT_ONE_TRUE
        public const long TEST_RESULT_PART_TRUE = 1;
        public const long TEST_RESULT_PART_FALSE = 0;

        //TEST RESULT IN DATABASE
        public const string TEST_RESULT_TRUE = "Y";
        public const string TEST_RESULT_FALSE = "N";

        //SQL TRANSCATION HEADER AND END
        public const string SQL_TRANSCATION_START = "BEGIN TRY  BEGIN TRANSACTION";
        public const string SQL_TRANSCATION_END = "COMMIT TRANSACTION  END TRY  BEGIN CATCH  ROLLBACK TRANSACTION  END CATCH";
    }

    //optical modem's type contains three chinese communication operators, they are china telecom, chana mobile, china unicom 
    public enum ModemType { YD_924, LT_952, DX_926,DX_927,DX_101,DX_924, DEFAULT }

    /// <summary>
    /// the step of work
    /// </summary>
    public enum WORK_STEP { WRITE_MSG, CHECK_WEB, NO_WHERE }


    //public enum LOG_TYPE { WRITE_TEST, RESET_TO_USER, INSPECT_WEB }
}
